{% extends 'users/base.html' %}
{% load form_helpers %}

{% block usercontent %}
    <form action="." method="post" class="h-100 vstack">
        {% csrf_token %}
        <div class="row align-content-start flex-fill">
            <div class="col-md-8 offset-md-2">
                {% if form.non_field_errors %}
                    <div class="card border-danger">
                        <div class="card-header bg-danger-subtle border-danger text-body">
                            <strong>Errors</strong>
                        </div>
                        <div class="card-body">
                            {{ form.non_field_errors }}
                        </div>
                    </div>
                {% endif %}
                <div class="card">
                    <div class="card-header"><strong>Password</strong></div>
                    <div class="card-body">
                        {% render_field form.old_password %}
                        {% render_field form.new_password1 %}
                        {% render_field form.new_password2 %}
                    </div>
                </div>
            </div>
        </div>
        <div class="nb-form-sticky-footer">
            <button type="submit" name="_update" class="btn btn-primary">
                <span aria-hidden="true" class="mdi mdi-check me-4"></span><!--
                -->Update
            </button>
            <a href="{% url 'user:profile' %}" class="btn btn-secondary">
                <span aria-hidden="true" class="mdi mdi-close me-4"></span><!--
                -->Cancel
            </a>
        </div>
    </form>
{% endblock %}
